package com.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 杨三炮
 * @Date 2022/7/17 16:30
 */
@RestController
@Slf4j
public class HelloController {

    @Value("${server.port}")
    private String port;
    @GetMapping()
    public ResponseEntity<String> test(){
        log.info("你好世界！ ... "+port);
        return ResponseEntity.ok("你好世界，当前访问："+port);
    }
    @GetMapping("/test")
    public ResponseEntity<String> test1(){
        return ResponseEntity.ok("Hello World! 你好世界！");
    }
}
